#ifndef __READER_H
#define __READER_H
#include <iostream>
#include <list>
#include <string>
using namespace std;

/**
 * @brief 读者类
 *
 */
class Reader
{
public:
	int id;
	string name;
	string password;

	Reader(int, string, string);
	static list<Reader> ReaderList;

	static int getNextReaderId();
	static string toJson();
	static list<Reader> fromJson(string);

	friend ostream& operator<<(ostream& output, const Reader& r);
	friend bool operator==(const Reader& a, const Reader& b);

	static Reader* queryById(int);
	static Reader* queryByName(string);
	static int delById(int);

	static void addReader();
	static void listReader();
	static void delReader();

	static const char* file_name;
	static void saveFile();
	static void loadFromFile();
};

#endif
